pokemonessentialsfandomcom_es-20200214-history
Secciones de scripts
Abajo se muestra una lista de las secciones de scripts que contienen todo el código de Pokémon Essentials (Versión 16.1). Cada sección ofrece una descripción breve de su objetivo y lista sus métodos y clases principales. Se existe una página dedicada a alguno de los scripts, se dejará su enlace. La lista de métodos y clases no es exhautiva (ya que éso podría tomar mucho espacio y tiempo de documentación), pero sí es representativa. Los programadores que busquen un método particular de una librería, por favor, utilicen la función Ctrl+Shift+F en el Editor de Scripts de RMXP para "Buscar en todos". Settings Configuración. Esta sección consiste en una colección de características que el usuario puede modificar fácilmente. Las opciones disponibles son las que la mayoría de los usuarios podrían querer modificar. Se incluyen interruptores y constantes para: * Tamaño de la pantalla * Nivel máximo de un Pokémon, nivel de eclosión, probabilidades de shiny y pokérus * Overworld Mechanics: poison, fishing, diving, berries * Infinite TMs * Day/Night Shading * Signposts (the route name that appears on-screen) * Battle Mechanics: physical/special split, Gen 6 battle and EXP mechanics, scaled EXP, critical capture * Badge boosts, Badge requirements for HM use. * Bag pocket names, size limits, and sorting. (pbPocketNames) * Storage system size, and creator name (pbStorageCreator) * Pokedex mechanics (pbDexNames) * Money limits * Rival names in battle * Roaming pokemon settings * Poké Radar settings * Region map extras * Contest settings * Assigning global switches, common events, and animations to Essentials mechanics. * Idiomas para localización. * Whether to allow the user to use the keyboard instead of the on-screen keyboard to enter text. RGSS2Compatibility These scripts support the use of RGSS2 players in Pokémon Essentials. Note that this is not the same as Essentials being compatible with RPG Maker VX - only the RGSS2 player is compatible. RPG__Sprite This section contains the basic definition of what a sprite is. Practically everything visual in the game depends on this. Win32API This section connects the game with Window's API, which allows it to do things like reposition the main window and set the window title. Sockets This section handles how the game can connect to the Internet and retrieve information. This is used by Essentials' Mystery Gift function. DebugConsole This section defines the debug console built into Essentials. To use the console, open up the debug menu in-game (F9) and select the "Open Debug Console" option at the bottom of the list. This console cannot be typed into (usually), but it will output logging information. To log to the console, use Kernel.echo(string) or Kernel.echoln(string). Game_Temp This section defines Game_Temp, which handles all temporary data. This data is NOT saved in a save game. Use $game_temp to access the global instance of this class. Most all of the data kept in this class is used by Essentials internally; chances are slim that you'll need to touch this data. Game_System This section defines Game_System, which handles various system data which is saved in the save file. Use $game_system to access the global instance of this class. There are functions which play music and sound effects in this class. Game_Switches This section defines Game_Switches, which handles the game's Global Switches. Use $game_switches to access the global instance of this class. You cannot have more than 5000 switches. Note: Script Switches do not have the results of their scripts stored in them. For example, $game_switches15 (switch 15, defined as "s:PBDayNight.isNight?(pbGetTimeNow)") will always contain false regardless of the time of day. Game_Variables This section defines Game_Variables, which handles the game's Global Variables. Use $game_variables to access the global instance of this class. You cannot have more than 5000 variables. Game_SelfSwitches This section defines Game_SelfSwitches, which handles the game's event Self Switches. Use $game_self_switches to access the global instance of this class. Keys into this hashmap are an array, of the form eventid, switchname. You should use the function pbSetSelfSwitch(eventid,switch,value) to set self-switches of other events on the current map. Game_Screen This section defines Game_Screen, which handles visual effects such as changing the colour tone of the screen or flashing. Use $game_screen to access the global instance of this class. Game_Picture This section defines Game_Picture, which handles displaying pictures. Instances of this class are used in Game_Screen. Game_Map This section defines Game_Map, which contains the basic definition of a game map. Use $game_map to access the current map's instance. Game_Map_Resolution This section extends Game_Map to allow Essentials to scale up the game, and includes display corrections for when the map is set to snap to edges (i.e. the screen stops scrolling). Game_Map_Autoscroll This section extends Game_Map to allow easier map scrolling for cutscenes. The functions listed to the right are defined in the Interpreter, and thus will work unadorned from event scripts. This section handles additional map scrolling features. These additional features include: * Scrolling to a given map location or to the player. * Following a moving character. * Setting the speed at which the scrolling occurs. * Scrolling diagonally. The supported commands are as follows: The above commands must be on a single line in an event's "Script" command, and must be the first line in that command. Game_CommonEvent This section defines Game_CommonEvent, which handles common events. Common events are those listed in the Database. Game_Character This section defines Game_Character, which handles various aspects of game events, including basic definition, forced move routes, centring the screen on the player, and bushes. Game_Event This section defines Game_Event, a subclass of Game_Character, which handles the basic details of events. This class defines a concept of "TempSwitches", which are switches which are kept in the instance of the Game_Event only, and not saved off even between map changes. Thus Temporary switches are reset when the player leaves the map and comes back. Doors in the Essentials example project use temporary switches to play the animation of the player leaving a house once and only once upon map load. (Hint: If you're having trouble making the exit animation on doors play when you're moving a player between rooms on the same map, set the temporary switches of the doors on the map back off as part of the transition.) The .switchIsOn?(id) function defined in this class is responsible for executing Script Switches and returning the result to the event's condition evaluation process. Game_Player This section defines Game_Player, a subclass of Game_Character, which handles the player character, including movement, checking whether a trainer can spot the player from a distance, tile passabilities, map scrolling and interacting with events. Use $game_player to access the global instance of this class. The function pbTriggeredTrainerEvents checks all events named "Trainer(##)" on the current map to see if they can reach the player. The function pbTriggeredCounterEvents checks all events named "Counter(##)" on the current map to see if they are facing the player. Both methods return all events that pass their respective checks in an array. Walk_Run This section extends Game_Player to how the player runs and cycles, including defining where these can be done and how quickly the player moves when they do so. It also defines the player's walking speed. Sprite_Character This section defines BushBitmap and Sprite_Character. They handle how bush tiles are displayed, and the display of an event's sprite. Sprite_Picture This section defines Sprite_Picture, which handles the display of sprite pictures (stored in "Graphics/Pictures/"). Sprite_Timer This section defines Sprite_Timer, which handles showing a window displaying a timer, usually one that counts down to 0. Sprite_Resizer This section extends several classes which allow the game to zoom the game to a 0.5, 1.5, and 2.0 times the size of normal. Spriteset_Map This section defines ReflectedSprite and ClippableSprite, which handle reflecting sprites in still water (terrain tag 6 tiles). It also defines Spriteset_Map, which handles displaying maps. Tilemap_XP This section defines CustomTilemap, as well as several supporting classes, which reimplement XP's Tilemap class with functionality for scaling and specialized autotiles. (?) Tilemap_Perspective This section defines Draw_Tilemap along with a few helper methods, which deal with showing maps in perspective mode TilemapLoader This section defines TilemapLoader, which is a proxy class for the various kinds of TileMap classes defined in previous sections. TileDrawingHelper This section defines TileDrawingHelper, which handles how autotile graphics are arranged, and how to draw them and regular tiles. AnimationSprite This section defines AnimationSprite, which is used to display one-off animations on the map (like grass rustling). This section extends Spriteset_Map to use AnimationSprite. ParticleEngine This section defines Particle_Engine and helper classes, which handle the display of particle effects, such as those on Route 3 in the Essentials example project. It defines the effects "fire", "smoke", "teleport", "spirit", "explosion", "aura", "soot", "sootsmoke", "rocket", "fixteleport", "smokescreen", "flare", "splash", and "starteleport". This section extends the Game_Event class to support these particle effects. DynamicShadows This section defines Sprite_Shadow, which displays the dynamic sprite shadows created when walking near a shadow source (as seen on Cycling Road in the Essentials example project). This section extends Sprite_Character, Game_Event, and Spriteset_Map to support this. Interpreter This section defines Interpreter, which handles the running of game events. This class defines how the game runs every command you can put in an event. See the execute_command function to find which command_### function applies to which event command. Event This section defines Event, which is an event listener structure (and not related to RMXP events). Given an instance of the Event class evt, you can register a callback to be run by using: evt+=proc This section defines several functions for file IO. Intl_Messages This section defines Messages, MessageTypes, OrderedHash, and several functions for internationalization. PBDebug This section defines PBDebug, which handles logging to files. Audio This section defines the Audio module, which handles the playing of audio files. AudioPlay This section defines several global functions for playing audio. These functions are likely what you want to use if you want to play audio from a script. AudioUtilities This section extends the Audio module to include ways to generate sounds and notes on the fly. Helper methods include ways to create tones you would hear on a phone. It also defines functions for recording audio and saving it off, used in Essentials' implementation of the Chatter move. BitmapCache This section defines the BitmapCache module, which handles caching loaded image files. Window This section defines the Window class, which is the base class for text windows, command lists, etc. The code to draw the windows from a small bitmap is defined in this section. SpriteWindow Esta sección define muchas clases y métodos que Essentials utiliza para dibujar sus ventanas de interfaz de usuario y sus animaciones. También define algunos métodos para abrir archivos de datos. * El módulo MessageConfig definido en la parte superior del archivo define muchos de los colores y fuentes predeterminados utilizados por el sistema. * La clase de proxy AnimatedBitmap es utilizada por gran parte de la biblioteca para mostrar casi todo, desde los iconos de pokemon en la pantalla del equipo, hasta los participantes en batalla, los objetos de la bolsa y las cartas en el minijuego Triple Tríada. * La clase SpriteWindow es la base para cada ventana utilizada por la interfaz de usuario de Essentials. Tiene muchas subclases que sirven a muchos propósitos diferentes. * El método pbFadeOutIn se utiliza en varios lugares como efecto de transición a un nuevo submenú, como cuando se entra en la pantalla del equipo desde el menú de pausa. DrawText This section defines several methods which handle the drawing of text to the screen, as well as the effects of the various message modifiers (colour changes, repositioning, displaying extra things, etc). Messages This section defines many of the methods Essentials uses to display messages to the player. * Kernel.pbMessage is the most basic message display, and the one you most often will use when displaying a message from a script. It is the method called internally when you use a Text Command in an event. * Kernel.pbConfirmMessage and pbConfirmMessageSerious display a Yes/No (or in the case of -Serious, a No/Yes) choice to the player. * Kernel.pbMessageChooseNumber will ask the player to enter a number. * Kernel.pbMessageDisplay is the eventual call of all of the above. This is where the message you passed has all of its modifiers and text replacements processed. TextEntry This section defines several methods and classes which handle the various text entry methods available in Essentials. EventScene This section defines the EventScene class, which is the base class for scenes that are not menus and not maps, such as the Intro splash screens, and the screen displaying the controls when starting the game. It also defines pbEventScreen(evtScene), which displays a subclass of the EventScene. Scene_Map This section defines the Scene_Map class, which is defines the scenes while the player character is walking around in the overworld. This class is where transferring the player, updating the map, input handling while in the overworld is handled. Scene_Intro This section defines the IntroEventScene and Scene_Intro classes, which handle the intro and splash screens that appear at the start of a game. Scene_Controls This section defines the ButtonEventScene class, which handle the display of the controls screen, usually provided at the start of a new game when the professor asks if there is any help he can give. Scene_Movie This section defines the Scene_Movie class, which handles the playing of AVI movie files in-game. Movies must be in a folder "Movies" in the main game directory. Use the following code to load a movie scene: $scene = Scene_Movie.new("MovieName") When the movie is done or the player presses B, the game will return to the overworld view (the Scene_Map). Scene_Credits This section defines the Scene_Credits class, which handles the display of the credits. To insert your own credits, edit the lines that say "Credits go here". To play the credits, use the following script: $scene = Scene_Credits.new All graphics used by this script are in the "Graphics/Titles" folder. You can add or change the images used by editing the CreditsBackgroundList at the top of this script section. The credits are displayed with a scrolling effect. Transitions This section overrides Graphics.transition to define several transition effects that occur just before a battle starts. Tip: If you're experiencing issues with the fade effect when using Graphics.transition comment out lines 95 and 96 in this section: elsif dc "" @@transition=FadeTransition.new(duration) Doing so will revert the fade effect to the stock RMXP fade effect. MiscData This section defines the PokemonMetadata module, which defines the various metadata that Essentials looks for in the metadata.txt PBS file. This section also defines a class for Phone metadata and several methods to get map metadata. PBMove This section defines PBMoveData and PBMove classes, which handles moves, both reading the move data from the data files and defining the properties of a move (e.g. type, PP, etc.). PBStatuses This section defines the PBStatuses module, which is where permanent (i.e. out of battle) Pokémon statuses are enumerated. This does not include confusion/infatuation/etc. which are all "volatile" in-battle conditions which a Pokémon can have in addition to a permanent status. The effects of these statuses are not included here. The Pokérus status is also not defined here, as it is an unrelated effect. PBTypes_Extra This section extends the PBTypes class, which handles data regarding elemental types, including their Physical/Special category and type effectiveness calculations. PBNatures This section defines the PBNatures module, which enumerates the ID numbers and names of Pokémon natures. The effects of natures are not included here. PBExperience This section defines the PBExperience module, which lists the experience thresholds for each level for each growth type. The thresholds for levels below 100 are listed as individual numbers in an array, whereas those for level 101 and above have formulae for calculating them. PBStats This section defines the PBStats module, which enumerates the eight stats that all Pokémon have. This includes HP, Attack, Defense, Speed, Special Attack, and Special Defense, as well as the two in-battle stats, Accuracy and Evasion. PBRibbons This section defines the PBRibbons module, which enumerates the ID numbers, names and descriptions of ribbons. PBEggGroups This section defines the PBEggGroups module, which enumerates the ID numbers and names of the various egg groups. PBColors This section defines the PBColors module, which enumerates the IDs and names of the Pokedex color categories. PBEnvironment This section defines the PBEnvironment module, which enumerates the different environment types. These environment types are used to determine the appropriate backdrops for battles, as well as some move effects. PBEffects This section defines the PBEffects module, which enumerates all the variables used for lingering effects of attacks/abilities/items (e.g. Choice Band, Disable, Protect, Flinch, Toxic). Their effects are not included here. PBWeather This section defines the PBWeather module, which enumerates all the possible in-battle weather types. The effects of in-battle weather are not included here. PBTargets This section defines the PBTargets module, which enumerates all possible target combinations for a given move. PokeBattle_ActiveSide This section defines the PokeBattle_ActiveSide and PokeBattle_ActiveField classes, which contain the variables used for lingering move effects that affect all Pokémon on the battle field or just one side of a battle (i.e. the player's side or the opposing side). Their effects are not included here. PokeBattle_DamageState This section defines the PokeBattle_DamageState class, which is used in the PokeBattler_Battler class (see below) to keep track of several different flags used in battle for damage calculation, including the last amount of hp lost, whether the last hit was a critical, whether a substitute too the damage, etc. PokeBattle_Battler This section defines the PokeBattle_Battler class. A battler is a separate entity to a Pokémon. This allows the battler to be changed in dramatic ways (e.g. using Transform) without affecting the Pokémon it is based on. This section defines all the in-battle properties a battler has. This includes species, level, moves, stats, etc. (copied from the Pokémon), as well as things like whether it is fainted, what its last used move was, the stat modifier stages, and which other battlers will gain experience from it when it is defeated. It also contains various functions that affect individual battlers, including one that faints the battler, one that determines the battler's modified speed, ones that affect status, one that describes what happens when a held item is consumed, ones that modify attack targets based on various effects, one that determines whether the battler will obey the trainer (and what happens if they don't), and ones that describe how a move is used. It also contains methods that describe form-changing during battle. PokeBattle_BattlerEffects This section extends the PokeBattle_Battler class to handle various in-battle effects, such as whether a battler can be given a particular status (also checks immunities to that status), inflicting statuses, status effects, and stat stage modifications. PokeBattle_Move This section defines the PokeBattle_Move class, which is the base class for all move classes. It handles moves in battle, including effectiveness calculations, accuracy check, power modifications, critical hit chance and damage calculation. PokeBattle_MoveEffects This section defines hundreds of subclasses of PokeBattle_Move, one for each move. Usually each of these subclasses override the pbEffect method to implement the how the given move works and animates in battle. Notably implemented first in the section are: * PokeBattle_UnimplementedMove - a error handler move class for moves which are defined in the PBS file but don't have a subclass defined for them. Damaging moves do damage and nothing else, while status moves always fail. * PokeBattle_FailedMove - A superclass for moves that always fail. * PokeBattle_Confusion - A class which implements the pseudo-move used by a battler against itself when it hurts itself in confusion. * PokeBattle_Struggle - An implementation for Struggle, should the move not be defined in the PBS file. PokeBattle_Battle This section defines the PokeBattle_Battle class, which handles the main battle process, from starting the battle through processing the phases (command, attack and end-of-round) to calculating the result and awarding Exp/money. Two methods defined in PokeBattle_Battle, pbRandom and pbAIRandom, are called whenever the battle needs a random number to use. By default, they simply call Ruby's rand() method, but they can be easily overridden to use another random number generator, if desired. The method pbJudge is called after every step of battle where a pokemon can get damaged. It determines which side of the battle won, if any side has won yet. The method pbGainExpOne has code to celebrate a level up, and the method pbLearnMove is called to ask the player which move will be forgotten for a new move learned. PokeBattle_AI This section extends the PokeBattle_Battle class to add several methods for the AI to use in determining what enemy trainers should do in battle. The pbGetMoveScore consists of a gigantic case statement with function codes for every move, and individually weights the viability of the given move. This section also defines PBTrainerAI, which enumerates the thresholds for AI skill levels (given for a trainer class in the trainertypes.txt file). 0 is defined as a wild pokemon; 1-31 is for basic, inexperienced trainers; 32-47 for trainers with some skill; 48-99 for trainers with high skill, and 100 for expert trainers like gym leaders and the E4. PokeBattle_SceneConstants This section defines the PokeBattle_SceneConstants module, which contains various values which are used to determine the layout and appearance of the battle screen. PokeBattle_Scene This section defines the PokeBattle_Scene class and several helper classes, which handle all the visual features of the battle screen, including the command menus, information boxes, all the sprites, and various animations (Pokémon being called out/returned, throwing Poké Balls, fainting, HP/EXP bars, etc.). Note: This section used to be called PokeBattle_ActualScene prior to version 16 of Essentials. PokeBattle_AnimationPlayer This section defines a few classes that handle the displaying of animations that were defined in the Database or the Animation Editor, and the conversion of the former to the latter. The vast majority of these animations are those used in battle. PokeBattle_SafariZone This section defines the PokeBattle_SafariZone and PokeBattle_FakeBattler classes, which handle the battle process for Safari Zone battles (instead of PokeBattle_Battle). PokeBattle_BattlePalace This section defines the PokeBattle_BattlePalace class, a subclass of PokeBattle_Battle, which allows Battle Frontier-style Battle Palace battles, where pokemon choose their own moves based on their nature. PokeBattle_BattleArena This section defines the PokeBattle_BattleArena class, a subclass of PokeBattle_Battle, which allows Battle Frontier-style Battle Arena battles, where two pokemon fight for three rounds and are then judged on their mind, body, and skill rankings. PokeBattle_BattleRecord This section defines several subclasses which allow Essentials to record and play back recorded battles. This is used in the PBattle_OrgBattle section to record the organized battles. PokeBattle_OtherScenes This section contains classes which defined simple, debug implementation of a battle scene. It is mainly used for debugging purposes. Note: This section used to be called PokeBattle_Scene prior to version 16 of Essentials. PokeBattle_BattlePeer This section defines the PokeBattle_RealBattlePeer class, which handles the storing of newly-caught Pokémon in either the party or Pokémon storage. PokeBattle_Clauses This section extends the PokeBattle_Battle and PokeBattle_Battler classes, as well as a few move classes, to handle various battle rules that can be applied to battles, e.g. in the Battle Factory and various Stadium cups. This includes things like the "sleepclause", the "evasionclause", the "selfkoclause", etc. PBTerrain This section defines the PBTerrain module, which enumerates the available terrain tags that can be used on a tileset. PField_Field This section contains the bulk of the code for various things done in the field (that is, the overworld). These include: * Circle of darkness (for dark caves where Flash hasn't been used yet). * Location signpost window (showing the map's name when stepping onto a new map). * Light effects (for sprites that illuminate areas - shadows being cast are defined elsewhere). * The animation used to fade the screen before a battle. * Generating wild Pokémon and battles with them (both single and double). * The Pickup ability. * Jumping over a ledge. * Events that automatically occur: ** When a battle is started. ** When the player takes a step (poison and happiness gain, sliding on ice, animating tall grass). ** When the player enters a different map (change the weather, display the location window, etc.). ** When the map scene changes (e.g. Flash is used, automatically mount the bicycle). ** When the map updates (i.e. every frame). * Setting the last visited Poké Center location. * Starting/finishing surfing and cycling. * Fishing. * Whiting out after having all party Pokémon faint, and returning to the last Poké Center visited. * The animation for entering a cave. * Registering and deregistering a partner trainer. * Recording sound. * Interacting with an item ball, and receiving an item from an NPC. * Boulder movements. PField_FieldWeather This section defines the PBFieldWeather module, which enumerates all the types of field weather available. It also extends the RPG::Weather class to handle the animations for out-of-battle weather. All other aspects of weather are handled elsewhere. PField_Metadata This section defines the PokemonGlobalMetadata class, which is stored in $PokemonGlobal. This class stores a lot of miscellaneous data, including things like if the player is surfing or cycling, the player's step count, the players last pokemon center, the daycare, the mailbox, the item pc storage, etc. PField_MapFactory This section defines the MapFactoryHelper module and the PokemonMapFactory class. They handle loading and displaying map connections, and collisions across connection boundaries. PField_HiddenMoves This section defines the HiddenMoveHandlers module, which handles using moves outside battle. The bulk of this section contains handlers and methods for each of the field moves, including handlers for using them from the menu and using them by interacting with events or particular terrain tags. Handlers added to HiddenMoveHandlers::CanUseMove and HiddenMoveHandlers::UseMove will be called when the player selects a move from the party menu, while the various Kernel.* methods defined are to be called from events. This section also defines Kernel.pbTransferSurfing and Kernel.pbTransferUnderwater. If a doorway uses the normal transfer command, it automatically cancels any surfing or diving animations for the player. Thus, if the player can only travel through a given doorway while surfing or diving, you must use these respective methods to keep the player in the state of surfing or diving when they arrive on the other side of the transfer. PField_Encounters This section defines the EncounterTypes module, which enumerates the encounter types and rates. It also defines the PokemonEncounters class, which handles other information relating to wild Pokémon encounters, including generating them. PField_EncounterModifiers This section is for procedures which change wild Pokémon encounters in some way. An existing example is one which makes the wild Pokémon shiny if a certain Global Switch is ON. PField_RoamingPokemon This section defines several methods which handle roaming Pokémon. It keeps track of all roaming Pokémon, changes their positions when a new map is entered, and triggers a battle with a roamer if appropriate. PField_RandomDungeons This section defines several classes to handle the generation of random dungeon maps. PField_BerryPlants This section defines the pbBerryPlant method, along with helper classes, which handle the berry planting process. PField_DayCare This section defines several methods which handle the Day Care system, both the storing of Pokémon to be trained and the breeding aspect. It contains scripts that determine whether or not breeding should take place, generate eggs when appropriate, give experience to stored Pokémon, teach moves to Pokémon as they level up while in training, etc. PField_DependentEvents This section defines the DependentEvents class, which handles dependent events. PField_Time This section defines the PBDayNight module, which handles the day/night system in Essentials. It also contains some methods that calculate various astrological features (e.g. the moon's phase, the zodiac sign), and methods that check the current day, month, and season. PokeBattle_Trainer This section defines the PokeBattle_Trainer class, which handles a trainer's information, including their name, badges owned, money, their current party, the Pokédex completion and so on. The player is the primary example of this class, and the only persistent instance (stored in $Trainer). But a PokeBattle_Trainer instance is created for every trainer participant when a battle begins. PTrainer_NPCTrainers This section defines several methods which handle enemy trainers, most notably the trainer battle methods. pbLoadTrainer loads and check individual trainers and their teams (from the PBS file "trainers.txt"). Debug features such as the ability to add a new trainer are also defined here. PItem_Items This section defines several methods which handle various generic effects an item can have (e.g. modify HP/PP), as well as teaching a move to a Pokémon. It also contains a few useful methods that can be used to decide what kind of item something is (e.g. one you shouldn't toss, a mail item, etc.). PItem_ItemEffects This section defines over a hundred handlers implementing the effects of each item that can be actively used (i.e. not held items). PItem_PokeBalls This section defines the handlers for modifying the various Poké Balls, or handling their effects. This file also has the mapping from ball type to PBItem enum. PItem_PokeRadar This section defines methods and item handlers to operate the Poké Radar, including using the item, making grass shake and changing the probability that the chained Pokémon are shiny. PItem_Mail This section defines the PokemonMail class, as well as several helper methods to use and move mail around. PItem_Sprites This section defines the ItemIconSprite class, which handles displaying the item icon in the bag or mart screen. Interestingly, the icons can be animated if the icon is a 48 pixel tall image that has its animation frames laid out horizontally (48 pixels wide for each frame). PokeBattle_Pokemon This section defines the PokeBattle_Pokemon class, which (despite its name) defines a Pokémon outside of battle. Pokemon_MultipleForms This section extends the PokeBattle_Pokemon class and defines the MultipleForms module to handle the multiple forms some Pokémon can have, and defines all the stats and other information for each form that differs from its base form. Pokemon_MegaEvolution This section extends the PokeBattle_Pokemon class to add mega forms to all appropriate pokemon, by adding handlers to the the MultipleForms module defined above. Pokemon_ShadowPokemon This section handles everything related to Shadow Pokémon. This section defines the heart gauges on pokemon, defines the Relic Stone, adds handlers for scent items, defines the effects of Hyper Mode (actually Pokemon XD-style "Reverse Mode", but misnamed "Hyper Mode"), and defines classes for every shadow move introduced in XD. The Purify Chamber is handled in its own section. Pokemon_Evolution This section defines the PBEvolution module, which enumerates all of the various evolution methods available (including 5 "custom" methods). It also defines PokemonEvolutionScene, which plays the evolution animation scene, and the pbCheckEvolution method, which checks if the pokemon can evolve now. Pokemon_Chatter This section defines the pbChatter, which handles the out-of-battle part of the move Chatter, which is the ability to record a new sound for it to use. Pokemon_Sprites Esta sección define cuatro clases de sprite para mostrar pokemon. También define métodos que manejan el ajuste de la altura de los sprites battler de acuerdo con las tres métricas definidas para esa especie en el archivo PBS "pokemon.txt". PScreen_PauseMenu This section defines PokemonMenu_Scene and PokemonMenu, which handles the Pause menu. There is code in here to modify the menu when the player is in the Safari Zone or a Bug Catching Contest. PScreen_Pokedex This section defines PokemonPokedexScene, which handles the Pokédex screens, namely everything except the Area and Forms pages. PScreen_PokedexNestForm This section defines PokemonNestMapScene and PokedexFormScene, which handles (respectfully) the Area and Forms pages of the Pokédex. PScreen_Party This section defines PokemonScreen, which handles the party screen and choosing Pokémon from the party. PScreen_Summary This section defines PokemonSummaryScene, which handles the Pokémon summary screens, accessible from the Party screen and Pokémon storage. Data relevant to the selected Pokémon is displayed across five pages. PScreen_Bag This section defines the PokemonBag and PCItemStorage classes, which hold the items the player is carrying (stored in $PokemonBag and $PokemonGlobal.pcItemStorage, respectfully). This section also defines the PokemonBagScreen and ItemStorageScene classes, which handle the Bag screen and item storage screen, respectfully. PScreen_Pokegear This section defines the Scene_Pokegear class, which handles the Pokégear's main screen, i.e. the list of applications it has. PScreen_RegionMap This section defines the PokemonRegionMapScene screen, which handles displaying the region map. It is used when examining a map (from the Pokégear, the Town Map item, or a map on a wall) or when using Fly. This section defines the pbShowMap method, which can be called from an event to display a wall map. PScreen_Phone This section defines the PokemonPhoneScene and several methods which handle the phone, including registering trainers, generating random phone calls, deciding when the trainers become available for rematches, and the phone screen. PScreen_Jukebox This section defines the Scene_Jukebox class, which handles the Jukebox application of the Pokégear. PScreen_TrainerCard This section defines the PokemonTrainerCardScene and PokemonTrainerCard classes, which handle the Trainer card screen. PScreen_Load This section defines the PokemonLoad class. This class handles loading data from the save file, as well as displaying the Continue/New Game screen, starting a new game, and deleting a save file. This section also contains the FontInstaller class, which checks whether the necessary fonts are installed, and attempts to install them if they are not. PScreen_Save This section defines the pbSave method, which handles saving the game. PScreen_Options This section defines PokemonOptionScene, which handles the Options screen. This screen includes settings for the window skin, font, text speed, etc. It also lists the available message box skins and fonts. Lines 512 to 526 and specially marked with comments in this section: if you do not want your players to be able to change the size of the game from the default "Medium" (that is, 2 times the size of pokemon's graphics), you should comment out or delete that section. PScreen_Storage This section defines PokemonStorage and PokemonBox, which contain pokemon stored in the storage system. It also defines various classes to implement the storage screen, and a class to handle Regional Pokémon storage. At the bottom of this section, there are scripts that handle what happens when the PC is used (i.e. the menus and mail storage). Note: This section adds the Storage System PC and Trainer PC to the Pokemon Center PC list that is displayed when the player turns on a PC. It does this by creating classes for each, with the methods shouldShow?, name, and access defined, and passing a new instance of that class to PokemonPCList.registerPC. PScreen_EggHatching This section contains all the scripts relating to the hatching of eggs, including the animation that plays when an egg hatches and the timer which reduces the number of steps left before an egg hatches. PScreen_Trading This section defines the pbStartTrade method, which handles the Pokémon trade screen. It also contains a check for whether the newly received Pokémon should evolve because of the trade. PScreen_MoveRelearner This section defines the pbRelearnMoveScreen method, which handles the Move Relearner feature. It handles the teaching part only; usually there is a price to pay for this feature, and that should be implemented separately. PScreen_PurifyChamber This section defines the pbPurifyChamber method, and many support classes, which handle the Purify Chamber for Shadow Pokémon. This section adds the Purify Chamber option to the PC in the same way as outlined in PScreen_Storage. PScreen_Mart This section defines the pbPokemonMart method, which handles the Poké Mart screen. PScreen_MysteryGift This section handles the Mystery Gift system. The methods defined here are called by the load screen, defined above. Tip: The MYSTERYGIFTURL constant, defined at the top of this file, is the URL the game will check for the mystery gift. This url must point to the raw text file and not a landing page generated by an uploading service. You can test to see if the game will accept the mystery gift file by putting the url you have into a browser's incognito mode / private browsing mode window. If you can load up the text file in that window without logging into anything or clicking through anything, then the game will be able to access the text file successfully itself. PScreen_HallOfFame This section defines the HallOfFameScene class, which contains all the scripts related to the Hall of Fame. This section adds the Hall of Fame option to the PC in the same way as outlined in PScreen_Storage. PBattle_Safari This section handles the Safari Zone, except the Safari Zone battles themselves. It keeps track of steps taken, Balls remaining, etc. PBattle_BugContest This section handles all aspects of Bug Catching Contests, including battles, keeping track of time, Park Balls, and judging. PBattle_OrgBattle This section defines several methods and classes related to organized Battle Frontier-style battles. This includes: * Methods to record a battle challenge battle. * Methods to create a Battle Challenge or Battle Factory battle * Methods to determine if a trainer has eligible pokemon. PBattle_OrgBattleRules This section defines dozens of classes related to rules and restrictions on organized battles, as well as method to combine these classes into a ruleset for use in challenges and tournaments. It also has a commented out section at the bottom which outlines various rulesets previously used by real world Tournaments put on by the Pokemon Company in the past. PBattle_OrgBattleGenerator This section defines several methods and classes related to generating random trainers to adhere to a given ruleset for an organized battle. PBattle_BattleSwap This section defines the BattleSwapScreen and BattleSwapScene classes, which implement the pokemon rental screen used for the Battle Frontier-style Battle Factory. PMinigame_Duel This section defines the pbDuel method and PokemonDuel class, which handles the overworld Duel mini-game. PMinigame_TripleTriad This section defines methods and classes which handle the Triple Triad card mini-game. PMinigame_SlotMachine This section defines the pbSlotMachine method, which handles the Slot Machine mini-game. PMinigame_VoltorbFlip This section defines the pbVoltorbFlip method, which handles the Voltorb Flip mini-game. PMinigame_Lottery This section defines the pbLottery method, which handles the lottery mini-game. PMinigame_Mining This section defines the pbMiningGame method, which handles the Mining mini-game. PMinigame_TilePuzzles This section defines the pbTilePuzzle method, which handles the Tile Puzzle game. PSystem_Controls This section redefines the Input module, which handles the game controls and translating them from a keyboard press into an input. It also contains some mouse support. PSystem_System This section defines a few small methods which set up the game. PSystem_Utilities This section contains a number of extra methods that don't fit elsewhere. These include: * Methods that gather information from the player's computer. * The LinearCongRandom class, which is an implementation of the RNG system used by the actual pokemon core series (but is unused in Essentials by default). * Methods to parse JSON and XML. * Convenience methods to define and name the player character, or get information about the player character. * Various utility methods, including those for Event timing and getting Constants. ** pbGet and pbSet: the preferred way to get and set global variables. ** pbExclaim and pbNoticePlayer: used for events that spot the player at a distance. ** Methods that load Pokémon sprites and icons. ** Various sound- and music-related methods. ** Methods that add Pokémon in various ways, and stores/nicknames them. * The pbCreatePokemon method, which generates the Demo Party available from the Debug menu. * Methods involved with party manipulation. * A method that calculates a balanced version of a given party of Pokémon. * Methods that let the player choose a Pokémon from their party. * Methods that check if a pokemon in the player's party has a move. * Methods that return the Regional/National Dex numbers of a species, and one that compiles a Regional Dex list. * Move Tutor methods. Debug This section defines the pbDebugMenu methods, which defines the Debug menu that can be accessed from the Pause menu. TilesetEditor This section handles the Debug mode option that allows you to change the terrain tags of tiles in a tileset. BattleAnimationsEditor This section defines dozens of UI classes and methods that are used in the Animation Editor, which is used for creating animations of moves being used in battle. Editor This section defines many UI elements to handle the in-game Debug Mode editors, allowing you to edit the contents of some of the PBS files. Compiler This section handles the compiling of all information in the PBS files into a set of data the game can actually use. Note: This section defines pbFixEventUse, which is responsible for going through your maps and events and fixing many minor common errors developers make in their coding, including things like replacing door transfers with properly done door events, normalizing the use of "\b" and "\r" in text, replacing "pbItemBall" with "pbReceiveItem" on non-item events, deleting superfluous exit commands, etc. This section also defines pbConvertToItemEvent, which will turn a simple events named a certain way into full item ball events. For example, if you make a new event simply named "Item:POTION" or "HiddenItem:POTION", the compile will turn the event into a full Item Ball or Hidden Item event which will give the player one potion. This section also defines pbConvertToTrainerEvent, which will turn an event into a trainer, as outlined by the Trainers page. Basically, if something changes in your project after you do a test run of your game without your doing it (for better or worse), it is likely the fault of the Compiler script section. Main This section defines the entry point of the game. It is what starts the game running and brings up the title screen. This section must always be the last script section. If you are adding any extensions to the game from a tutorial on this wiki or a thread in the community forum, they will more often than not tell you to place it right above this section. This is because scripts placed lower will override scripts placed in higher script sections, but scripts placed below Main will never run, as Main is where the main game loop runs. Compiled Scripts There are some classes and methods which are not defined in script sections, but are compiled directly from from PBS files by the Compiler. The following are classes you won't find defined in the Script Editor. All of these classes simply enumerate their values. They don't have any logic, but they'll usually have a method to get the printable name of the enum. PBTypes This is the list of types, defined in types.txt. The script compiles to the following, from the unmodified example project: class PBTypes NORMAL=0 #defined types... DARK=17 def PBTypes.getName(id) return pbGetMessage(MessageTypes::Types,id) end def PBTypes.getCount; return 18; end def PBTypes.maxValue; return 17; end end PBAbilities This is the list of all abilities, defined in abilities.txt. The script compiles to the following, from the unmodified example project: class PBAbilities STENCH=1 #defined abilities... TERAVOLT=164 def PBAbilities.getName(id) return pbGetMessage(MessageTypes::Abilities,id) end def PBAbilities.getCount return 164 end def PBAbilities.maxValue return 164 end end PBMoves This is a list of all moves, defined in moves.txt. The script compiles to the following, from the unmodified example project: class PBMoves MEGAHORN=1 #defined moves... WITHDRAW=559 def PBMoves.getName(id) return pbGetMessage(MessageTypes::Moves,id) end def PBMoves.getCount return 559 end def PBMoves.maxValue return 559 end end PBItems This is a list of all items, defined in items.txt. The script compiles to the following, from the unmodified example project: class PBItems REPEL=1 #defined items... SHINYCHARM=525 def PBItems.getName(id) return pbGetMessage(MessageTypes::Items,id) end def PBItems.getNamePlural(id) return pbGetMessage(MessageTypes::ItemPlurals,id) end def PBItems.getCount return 525 end def PBItems.maxValue return 525 end end PBSpecies This is the list of pokemon species, defined from pokemon.txt. Note that the PBSpecies enum corresponds to the national pokedex number of the pokemon species, and thus you can use PBSpecies::QUILAVA as a constant for Quilava's national dex number. The script compiles to the following, from the unmodified example project: module PBSpecies BULBASAUR=1 IVYSAUR=2 #defined pokemon... MELOETTA=648 GENESECT=649 def PBSpecies.getName(id) return pbGetMessage(MessageTypes::Species,id) end def PBSpecies.getCount return 649 end def PBSpecies.maxValue return 649 end end PBTrainers This is a list of all trainer types, defined in trainertypes.txt. The script compiles to the following, from the unmodified example project: class PBTrainers POKEMONTRAINER_Red=0 #defined trainer types... CHAMPION=71 def PBTrainers.getName(id) return pbGetMessage(MessageTypes::TrainerTypes,id) end def PBTrainers.getCount return 72 end def PBTrainers.maxValue return 71 end end